def calcuate(num1,num2,operator):
    if operator == '+':
       return num1 + num2
    elif operator == '-':
       return num1 - num2
    elif operator == '*':
       return num1 * num2
    elif operator == '/':
       return num1 / num2
    else:
       return None

while True:

    num1 = float(input("请输入第一个数："))
    operator = input("请输入运算符(+、-、*、/): ")
    num2 = float(input("请输入第二个数："))
    result = calcuate(num1,num2,operator)
    if result is not None:
       print("计算结果为：",result)
    else:
       print("请重新输入！")
